package com.example.users.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Size;
import lombok.Data;

import java.time.LocalDateTime;

@Data
@TableName("uc_admin")
public class Admin {
    @TableId(type = IdType.AUTO)
    @NotNull(groups = com.example.users.validation.groups.Update.class, message = "id 不能为空")
    private Long id;

    @NotBlank(groups = {com.example.users.validation.groups.Create.class}, message = "用户名不能为空")
    @Size(max = 64, message = "用户名长度不能超过64")
    private String username;

    @NotBlank(groups = {com.example.users.validation.groups.Create.class}, message = "密码不能为空")
    private String passwordHash;

    private String salt;
    @Size(max = 64, message = "昵称长度不能超过64")
    private String nickname;
    private Boolean enabled;
    private LocalDateTime createdAt;
    private LocalDateTime updatedAt;
}


